<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/10/16
 * Time: 18:53
 */
class DB
{
    static $obj=null;
    private  function _construct(){
        echo "mysql linked....";
    }
    static  function getObj(){
        if(is_null(self::$obj)){
            self::$obj=new DB();
        }
        return self::$obj;

    }
}

var_dump(DB::getObj());
var_dump(DB::getObj());